You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > Optimization Class > Optimization Methods > MinBrent Method > Optimization.MinBrent Method (double, double, TRealFunction, [In] TMtxFloatPrecision, [In] double[], [In] object[], out double, int, double, [In] TStrings)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Optimization.MinBrent Method (double, double, TRealFunction, [In] TMtxFloatPrecision, [In] double[], [In] object[], out double, int, double, [In] TStrings)

Minimizes single variable function.

Syntax
C#
Visual Basic
public static int MinBrent(double ax, double bx, TRealFunction Func, [In] TMtxFloatPrecision FloatPrecision, [In] double[] Consts, [In] object[] ObjConst, out double MinX, int MaxIter, double Accuracy, [In] TStrings Verbose);
Parameters 
Description 
double ax 
Defines initial lower limit for minimum search. 
double bx 
Defines initial uššer limit for minimum search. 
TRealFunction Func 
Real functin of single variable (must be of TRealFunction type) to be minimized. 
[In] TMtxFloatPrecision FloatPrecision 
Specifies the floating point precision to be used by the routine. 
[In] double[] Consts 
Additional Fun constant parameters (can be/is usually nil).  
[In] object[] ObjConst 
Additional Fun constant parameters (can be/is usually nil). 
out double MinX 
Returns the position of function minimum. 
int MaxIter 
Maximum allowed numer of minimum search iterations. 
double Accuracy 
Desired minimum position tolerance. 
[In] TStrings Verbose 
If assigned, stores Func, evaluated at each iteration step. Optionally, you can also pass TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring. 

the number of iterations required to reach the solution(minimum) within given tolerance.

Minimizes the function of one variable. This routine uses slightly modified version of the algol 60 procedure localmin, introduced by Richard Brent.

Problem: Find the minimum of the function of single variable by using the Brent method. 

Solution:The function is defined by the following equation: 

 

 

private double Fun(TVec pars, TVec c, params object[] o) { return Math.Sin(Pars[0])+Math387.IntPower(Pars[0]+2,2); // note that Pars holds only one variable ! } private void Example() { // initial estimates for x1 and x2 double x; double res = Optimization.MinBrent(-10,10,Fun,TMtxFloatPrecsion.mvDouble,null,null,out x, 500,1e-8,null); // stop if Iters >500 or Tolerance < 1e-8 // Returns res = -1.8582461797 }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!